<?php
namespace Plugin\Attractions\Commerce\Schema\Commerce_merchant;

use Plugin\Attractions\Commerce\Model\Commerce_merchant\CommerceMerchant;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 商户信息
 */
#[Schema(title: 'CommerceMerchantSchema')]
class CommerceMerchantSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '主键ID', type: 'bigint')]
    public string $id;

    #[Property(property: 'spot_id', title: '点位ID', type: 'bigint')]
    public string $spot_id;

    #[Property(property: 'merchant_name', title: '商户名称', type: 'varchar')]
    public string $merchant_name;

    #[Property(property: 'merchant_type', title: '商户类型：1-个体户，2-企业，3-虚拟商户，4-合作社，5-政府单位', type: 'tinyint')]
    public string $merchant_type;

    #[Property(property: 'legal_person', title: '法人代表', type: 'varchar')]
    public string $legal_person;

    #[Property(property: 'legal_person_phone', title: '法人联系方式', type: 'varchar')]
    public string $legal_person_phone;

    #[Property(property: 'legal_person_id_card', title: '法人身份证', type: 'varchar')]
    public string $legal_person_id_card;

    #[Property(property: 'contact_person', title: '商户联系人', type: 'varchar')]
    public string $contact_person;

    #[Property(property: 'contact_phone', title: '商户联系电话', type: 'varchar')]
    public string $contact_phone;

    #[Property(property: 'contact_email', title: '联系邮箱', type: 'varchar')]
    public string $contact_email;

    #[Property(property: 'address', title: '商店地址', type: 'varchar')]
    public string $address;

    #[Property(property: 'business_scope', title: '经营范围', type: 'text')]
    public string $business_scope;

    #[Property(property: 'open_time', title: '商户开门时间', type: 'timestamp')]
    public string $open_time;

    #[Property(property: 'close_time', title: '商户关门时间', type: 'timestamp')]
    public string $close_time;

    #[Property(property: 'registered_capital', title: '注册资本', type: 'decimal')]
    public string $registered_capital;

    #[Property(property: 'established_date', title: '成立日期', type: 'date')]
    public string $established_date;

    #[Property(property: 'business_license_url', title: '营业执照照片', type: 'varchar')]
    public string $business_license_url;

    #[Property(property: 'business_license', title: '营业执照号', type: 'varchar')]
    public string $business_license;

    #[Property(property: 'tax_id', title: '税务登记号', type: 'varchar')]
    public string $tax_id;

    #[Property(property: 'bank_name', title: '开户银行', type: 'varchar')]
    public string $bank_name;

    #[Property(property: 'bank_account', title: '银行账号', type: 'varchar')]
    public string $bank_account;

    #[Property(property: 'status', title: '商户状态：1-正常营业，2-歇业，3-注销', type: 'tinyint')]
    public string $status;

    #[Property(property: 'remark', title: '备注', type: 'text')]
    public string $remark;

    #[Property(property: 'admin_id', title: '商户管理员ID', type: 'bigint')]
    public string $admin_id;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;




    public function __construct(CommerceMerchant $model)
    {
       $this->id = $model->id;
       $this->merchant_name = $model->merchant_name;
       $this->merchant_type = $model->merchant_type;
       $this->legal_person = $model->legal_person;
       $this->legal_person_phone = $model->legal_person_phone;
       $this->legal_person_id_card = $model->legal_person_id_card;
       $this->contact_person = $model->contact_person;
       $this->contact_phone = $model->contact_phone;
       $this->contact_email = $model->contact_email;
       $this->address = $model->address;
       $this->business_scope = $model->business_scope;
       $this->open_time = $model->open_time;
       $this->close_time = $model->close_time;
       $this->registered_capital = $model->registered_capital;
       $this->established_date = $model->established_date;
       $this->business_license_url = $model->business_license_url;
       $this->business_license = $model->business_license;
       $this->tax_id = $model->tax_id;
       $this->bank_name = $model->bank_name;
       $this->bank_account = $model->bank_account;
       $this->status = $model->status;
       $this->remark = $model->remark;
       $this->admin_id = $model->admin_id;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'merchant_name' => $this->merchant_name ,'merchant_type' => $this->merchant_type ,'legal_person' => $this->legal_person ,'legal_person_phone' => $this->legal_person_phone ,'legal_person_id_card' => $this->legal_person_id_card ,'contact_person' => $this->contact_person ,'contact_phone' => $this->contact_phone ,'contact_email' => $this->contact_email ,'address' => $this->address ,'business_scope' => $this->business_scope ,'open_time' => $this->open_time ,'close_time' => $this->close_time ,'registered_capital' => $this->registered_capital ,'established_date' => $this->established_date ,'business_license_url' => $this->business_license_url ,'business_license' => $this->business_license ,'tax_id' => $this->tax_id ,'bank_name' => $this->bank_name ,'bank_account' => $this->bank_account ,'status' => $this->status ,'remark' => $this->remark ,'admin_id' => $this->admin_id ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at];
    }
}